/*
 * Copyright (C) 2014 - present Instructure, Inc.
 *
 * This file is part of Canvas.
 *
 * Canvas is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License as published by the Free
 * Software Foundation, version 3 of the License.
 *
 * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 */

@import "base/environment";
@import "base/mixins/misc";

/* header */

#edit_assignment_header-cr {
  padding: 0;
  border: none;
}

#edit-assignment-header-cr-tab-nav {
  display: flex;
  align-items: flex-end;
}

#edit-assignment-header-cr-spacer {
  flex: 1;
}

#assignment-draft-state-cr {
  padding: 0 12px 12px 0;
}

#assignment-gear-button-cr {
  padding-bottom: 6px;
}

#assignment_description {
  width: 100%;
  min-height: 300px;
}

/* for labels */
div.form-column-left {
  width: 145px;
  text-align: right;
  margin-top: 20px;
  display: inline-block;
  vertical-align: top;
  padding: 5px 10px;
  @include fontSize(14px);
  line-height: 20px;

  &.no-group {
    /* for labels that correspond to an un-grouped form el */
    margin-top: 0px;
  }
}
#discussion_point_change_warning {
  margin-top: 15px;
  margin-bottom: 0px;
  margin-left: 180px;
  display: inline-block;
  display: none;
}
/* for grouped and un-grouped form els */
div.form-column-right, div.overrides-column-right {
  display: inline-block;
  width: 380px;

  /* for groups of form els ONLY */
  .border {
    /* parent form-column-right div should have a child */
    /* div that applies border styles and hold content */
    /* using bootstrap or other canvas borders */
    border-color: #ccc;
    padding: 15px 0px;
    margin-top: 20px;
    select, .subtitle {
      margin-left: 15px;
    }
  }

  label:hover {
    background: #E7F4FF;
  }

  /* if form field is first item in box */
  label.flush {
    margin: 0px;
  }

  label:not(.ic-Label), label.date_field {
    margin: 0px;
    padding: 10px 0px 10px 40px;
  }

  .subtitle {
    margin-top: 20px;
    padding-bottom: 5px;
    @include fontSize(15px);
    font-weight: bold;
  }

  /* nested form els within a group */
  .nested {
    label.checkbox, label.radio {
      padding-left: 60px;
    }
    select, a, .explanation {
      margin-left: 40px;
    }
    input[type=text] {
      margin-left: 60px;
    }
    button.Button {
      margin: 7px 0px 0px 40px;
    }
    .nest {
      padding-left: 20px;
    }
  }
}

#similarity_detection_tools .form-column-right {
  #report_visibility_picker_label {
    padding: 0px 0px 10px 17px !important;
  }
  padding-left: 4px;
  iframe.tool_launch {
    margin: 15px 0px 0px 0px;
    width: 100%;
  }
}

.assignment-edit-group-alert, .assignment-edit-external-tool-alert{
  margin: 15px 20px 0;
}

#discussion-edit-view {
  @include readonly-input;
}

/* support for master class locked input fields */
#edit_assignment_form, #discussion-edit-view {
   h1.title {
     clear: both;
   }

   .to .ic-Form-control.readonly,
   .from .ic-Form-control.readonly {  // locked availability dates
     margin-bottom: 0;                // removes white space at bottom of assign box
   }

  .ContainerDueDate { // date inputs
    .Available-from-to {
      .from, .to {  // or the from and to collapse on each other in ie11
        width: 50%;
      }
    }
    // make the box of dates layout look right
    .ic-Form-control.readonly {
      input[type="text"].ic-Input[readonly] { // all that to override existing css selectors
        height: 1.4em;
        padding: 0;
      }
      label {                             // tighten it up
        margin-bottom: 0;
      }
    }
  }
}

#edit_assignment_form {
  .assignment_description {
    background-color: $ic-color-light;
  }
  #assignment_points_possible[readonly] { // points possible
    margin-top: -3px;   // because it sits too low
  }
}


#discussion-edit-view {
  .discussion-description {
    background-color: $ic-color-light;
  }

  #discussion_topic_assignment_points_possible[readonly] {
    margin-top: -3px;
  }
}
